package com.aboo.file1;

import java.util.UUID;
import java.util.concurrent.Callable;

public class WirteCallable implements Callable<Boolean> {

    private WriteKit writeKit;

    public WirteCallable(WriteKit writeKit) {
        this.writeKit = writeKit;
    }

    @Override
    public Boolean call() throws Exception {
        try {
            for (int i = 0; i < 10000; i++) {
                String msg = Thread.currentThread().getName() + " : " + UUID.randomUUID().toString();
                writeKit.write(msg);
            }
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }

        return true;
    }

}
